using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace NhaThuocOnline.Entities.Mapping
{
    public class BacSiMap : EntityTypeConfiguration<BacSi>
    {
        public BacSiMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.HoTen)
                .HasMaxLength(100);

            this.Property(t => t.Title)
                .HasMaxLength(100);

            this.Property(t => t.NoiLamViec)
                .HasMaxLength(100);

            this.Property(t => t.Phone)
                .HasMaxLength(20);

            this.Property(t => t.Fax)
                .HasMaxLength(20);

            this.Property(t => t.Email)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("BacSi");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.HoTen).HasColumnName("HoTen");
            this.Property(t => t.Title).HasColumnName("Title");
            this.Property(t => t.NoiLamViec).HasColumnName("NoiLamViec");
            this.Property(t => t.Phone).HasColumnName("Phone");
            this.Property(t => t.Fax).HasColumnName("Fax");
            this.Property(t => t.Email).HasColumnName("Email");
        }
    }
}
